<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Basic - 生成随机数</title>
</head>

<body>
    <script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.1-beta3/mock-min.js"></script>
    <div class="box">
        展示内容:<div id="content"></div>
    </div>
    <script>
        let Random = Mock.Random;

        let list = Mock.mock({

            //布尔值
            bool_1: Random.boolean(),
            bool_2: Random.boolean(1, 9, true),
            bool_3: Random.bool(),
            bool_4: Random.bool(1, 9, false),

            //随机数
            natural_1: Random.natural(),
            natural_2: Random.natural(10000),
            natural_3: Random.natural(60, 100),

            //整数
            integer_1: Random.integer(),
            integer_2: Random.integer(10000),
            integer_3: Random.integer(60, 100),

            //浮点数
            float_1: Random.float(),
            float_2: Random.float(0),
            float_3: Random.float(60, 100),
            float_4: Random.float(60, 100, 3),
            float_5: Random.float(60, 100, 3, 5),

            //随机字符
            character_1: Random.character(),
            character_2: Random.character('aeiou'),
            character_3: Random.character('number'),

            //字符串
            string_1: Random.string(),
            string_2: Random.string(5),
            string_3: Random.string('lower', 5),
            string_4: Random.string(7, 10),
            string_5: Random.string('aeiou', 1, 3),
            string_6: Random.string('壹贰叁肆伍陆柒捌玖拾', 3, 5),


            //整形
            range_1: Random.range(3),
            range_2: Random.range(3, 7),
            range_3: Random.range(1, 10, 2),
            range_4: Random.range(1, 10, 3),



        })

        //展示数据
        console.table(list)
        x = document.getElementById("content");
        //将对象转为JSON
        x.innerHTML = JSON.stringify(list, null, '<br />');

    </script>

</body>

</html>